import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from "@/components/guanli/Home.vue";
import students from "@/components/guanli/view/Students.vue";
import teachers from "@/components/guanli/view/Teachers.vue";
import exams from "@/components/guanli/view/exams.vue";
import login from "@/components/Login.vue";
import Img from "@/components/guanli/view/Img.vue";
import my from "@/components/guanli/view/My.vue";
import user from "@/components/guanli/view/User.vue";
import Shome from "@/components/student/Shome.vue";
import Saside from "@/components/student/Saside.vue";
import show from "@/components/guanli/view/question/Show.vue";
import addque from "@/components/guanli/view/question/Addque.vue";
import doque from "@/components/guanli/view/question/Doque.vue";
import score from "@/components/guanli/view/question/Score.vue";
import stuan from "@/components/guanli/view/question/Stuan.vue";
import Sscore from "@/components/student/question/Sscore.vue";
import Sstuan from "@/components/student/question/Sstuan.vue";
import sdoque from "@/components/student/question/Sdoque.vue";
import examss from "@/components/student/question/examss.vue";

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    name:'login',
    component: login
  },
  {
    path: '/home',
    name: '管理员首页',
    component: Home,
    children:[
      {
        path:'/students',
        name:'学生列表',
        component: students
      },
      {
        path:'/teachers',
        name:'老师列表',
        component: teachers
      },
      {
        path:'/exams',
        name:'考试行程',
        component: exams
      },
      {
        path:'/img',
        name:'图片',
        component: Img
      },
      {
        path:'/my',
        name:'我',
        component: my
      },
      {
        path:'/user',
        name:'用户管理',
        component: user
      },
      {
        path:'/show',
        name:'试卷管理',
        component: show
      },
      {
        path:'/score',
        name:'查看分数',
        component: score
      },
    ]
  },
  {
    path:'/doque',
    name:'管理员答卷',
    component: doque
  },
  {
    path:'/sdoque',
    name:'学生答卷',
    component: sdoque
  },
  {
    path:'/addque',
    name:'添加试卷',
    component: addque
  },
  {
    path:'/stuan',
    name:'管理员查看错题',
    component: stuan
  },
  {
    path:'/sstuan',
    name:'学生查看错题',
    component: Sstuan
  },
  {
    path:'/shome',
    name:'学生首页',
    component: Shome,
    children: [
      {
        path:'/sscore',
        name:'查看分数',
        component: Sscore
      },
      {
        path: '/saside',
        name:'学生列表项',
        component: Saside
      },
      {
        path:'/examss',
        name:'考试行程',
        component: examss
      },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
